#ifndef __I2C_H  
#define __I2C_H  

#include "includefile.h"
#ifdef USING_BOARD_RED
  #define MyIIC_SCL_Periph RCC_APB2Periph_GPIOB
  #define MyIIC_SCL_Port   GPIOB
  #define MyIIC_SCL_Pin    GPIO_Pin_13

  #define MyIIC_SDA_Periph RCC_APB2Periph_GPIOB
  #define MyIIC_SDA_Port   GPIOB
  #define MyIIC_SDA_Pin    GPIO_Pin_14
#endif
#ifdef  USING_BOARD_YELLOW
#define MyIIC_SCL_Periph RCC_APB2Periph_GPIOA
#define MyIIC_SCL_Port   GPIOA
#define MyIIC_SCL_Pin    GPIO_Pin_12

#define MyIIC_SDA_Periph RCC_APB2Periph_GPIOA
#define MyIIC_SDA_Port   GPIOA
#define MyIIC_SDA_Pin    GPIO_Pin_11
#endif
void IIC_Init(void);
void Check_IIC_Error(void);
void IIC_write_byte(uint8_t SlaveAddress, uint8_t REG_Address, uint8_t REG_data);
uint8_t IIC_read_byte(uint8_t SlaveAddress,uint8_t REG_Address);
void  IIC_read_bytes(uint8_t DevAddr,uint8_t DataAddr,uint8_t *RxBuffer,uint8_t RxLenth);
#endif 


